import { $Http } from '@/config/service/http';

export enum Api {
  // 通用文件接口
  fileCopyFile = '/dmsfile/fileInfo/copyFile', // 复制文件
  fileCopyFolder = '/dmsfile/fileInfo/copyFolder', // 复制文件夹
  fileGetAllFolders = '/dmsfile/fileInfo/getAllFolders', // 得到文件夹列表(无权限所有的文件夹列表)
  fileGetAllFoldersWithPriv = '/dmsfile/fileInfo/getAllFoldersWithPriv', // 查看自己可以访问的文件夹列表 包含（个人、部门、项目、资源文件夹等）文件夹列表
  fileGetFoldersWithPriv = '/dmsfile/fileInfo/getFoldersWithPriv', // 查看自己可以访问的文件夹列表 包含（个人、部门、项目）文件夹列表
  fileIsWatermarkUsed = '/dmsfile/fileInfo/isWatermarkUsed', // 判断水印是否已使用
  fileMoveFile = '/dmsfile/fileInfo/moveFile', // 移动文件
  fileMoveFolder = '/dmsfile/fileInfo/moveFolder', // 移动文件夹
  fileQueryFolderWithFile = '/dmsfile/fileInfo/queryFolderWithFile', // 文件夹和文件不分页查询
  fileQueryFolderWithFilePage = '/dmsfile/fileInfo/queryFolderWithFilePage', // 文件夹和文件分页查询
  // 文件回收站
  recycleBatchDelete = '/dmsfile/recycleBin/batchDelete', // 批量删除
  recycleBatchRestore = '/dmsfile/recycleBin/batchRestore', // 批量还原
  recycleDelete = '/dmsfile/recycleBin/delete', // 删除
  recycleGet = '/dmsfile/recycleBin/get', // 详情
  recyclePage = '/dmsfile/recycleBin/page', // 分页查询
  recycleRestore = '/dmsfile/recycleBin/restore', // 还原
  // 文件夹配置（磁盘文件管理）
  dirConfigGet = '/dmsfile/directoryConfig/getConfig', // 获取配置信息
  dirConfigSave = '/dmsfile/directoryConfig/save', // 保存配置信息
  dirConfigBatchSave = '/dmsfile/directoryConfig/batchSave', // 批量保存配置信息
  // 回收站配置
  recycleConfigDelete = '/dmsfile/recycleBinConfig/delete', // 删除
  recycleConfigGet = '/dmsfile/recycleBinConfig/get', // 详情
  recycleConfigGetConfig = '/dmsfile/recycleBinConfig/getConfig', // 得到当前用户回收站的配置
  recycleConfigPage = '/dmsfile/recycleBinConfig/page', // 分页查询
  recycleConfigSave = '/dmsfile/recycleBinConfig/save', // 保存
  recycleConfigSaveConfig = '/dmsfile/recycleBinConfig/saveConfig' // 保存当前用户回收站的配置
}

export const fileGetAllFolders = (params) => {
  return $Http.api(Api.fileGetAllFolders, params, 'post');
};

export const fileGetAllFoldersWithPriv = (params) => {
  return $Http.api(Api.fileGetAllFoldersWithPriv, params, 'post');
};

export const dirConfigGet = (params) => {
  return $Http.api(Api.dirConfigGet, params, 'get');
};

export const dirConfigSave = (params) => {
  return $Http.api(Api.dirConfigSave, params, 'post');
};

export const dirConfigBatchSave = (params) => {
  return $Http.api(Api.dirConfigBatchSave, params, 'post');
};

export const fileCopyFile = (params) => {
  return $Http.api(Api.fileCopyFile, params, 'post');
};

export const fileMoveFile = (params) => {
  return $Http.api(Api.fileMoveFile, params, 'post');
};

export const fileCopyFolder = (params) => {
  return $Http.api(Api.fileCopyFolder, params, 'post');
};

export const fileMoveFolder = (params) => {
  return $Http.api(Api.fileMoveFolder, params, 'post');
};

export const fileGetFoldersWithPriv = (params) => {
  return $Http.api(Api.fileGetFoldersWithPriv, params, 'post');
};
